{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os \n",
    "import sys\n",
    "import time\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from PIL import Image\n",
    "import cv2\n",
    "\n",
    "root_path = '/root/mall_stat/data'\n",
    "os.chdir(root_path)\n",
    "\n",
    "# sys.path.append(join(root_path,'utils'))\n",
    "\n",
    "from os.path import join,split,exists,dirname\n",
    "from tqdm import tqdm \n",
    "import shutil\n",
    "import json \n",
    "\n",
    "from my_utils.utils import * \n",
    "\n",
    "\n",
    "from entity.data_processor import  DataProcessor\n",
    "\n",
    "\n",
    "\n",
    "from collections import Counter "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/mall_stat/data/mall_staff_full/images\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "available_sites = ['CR_zhongshan_wxhpoc','JR_haerbin_jrzjxfd', 'HUALIAN_chengdu_skptftf'] \n",
    "site = 'CR_zhongshan_wxhpoc'\n",
    "data_root = join(root_path,'mall_staff_full','images')\n",
    "print(data_root,)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0%|          | 0/8 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the size becomes 10000, as it is large than threshold \t\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "\n",
    "\n",
    "# for site in available_sites:\n",
    "#     data_processor = DataProcessor(data_root, site)\n",
    "data_processor = DataProcessor(data_root, site)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'data_root' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m/tmp/ipykernel_10337/1144957500.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata_root\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'data_root' is not defined"
     ]
    }
   ],
   "source": [
    "print(data_root)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "apid_tid = {}\n",
    "for d in data_processor.dates:    \n",
    "    apid_tid.update(data_processor.pid2tid[d])\n",
    "\n",
    "apid_num = {k:len(v) for k,v in apid_tid.items()}\n",
    "\n",
    "\n",
    "\n",
    "counter_res = Counter(apid_num.values())\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = counter_res.keys()\n",
    "y = counter_res.values()\n",
    "plt.figure(dpi = 200)\n",
    "plt.bar(x,y)\n",
    "plt.yscale('log')\n",
    "plt.xlabel('tracklet length')\n",
    "\n",
    "plt.ylabel('tracklet number')\n",
    "plt.title('tracklet statistics')\n",
    "\n",
    "plt.savefig('stat.png')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "body quality  0.857029139995575\n",
      "uniform score:  0.0002423944097245112\n",
      "uniform feat:  [[0.13522005081176758, -0.12757955491542816, 0.04012484848499298, -0.06098025664687157, -0.03747070953249931, 0.1321362555027008, -0.10284093767404556, -0.2037321776151657, 0.07721712440252304, 0.16311240196228027, 0.2779700756072998, 0.12315907329320908, 0.053202055394649506, -0.11359678953886032, -0.2020045518875122, 0.16076430678367615, -0.056955885142087936, -0.08352571725845337, -0.011613412760198116, -0.005034103989601135, 0.074736587703228, 0.06237882003188133, -0.019670581445097923, 0.12058001756668091, 0.038158535957336426, 0.09191373735666275, 0.07528194785118103, -0.172109916806221, -0.09377400577068329, 0.06524696201086044, -0.09603356570005417, 0.03562133386731148, 0.16827264428138733, 0.04526832327246666, 0.04801042377948761, 0.05570627748966217, 0.12271863967180252, 0.046201374381780624, -0.12560482323169708, -0.058380819857120514, 0.04128457233309746, -0.008427050895988941, 0.05166689679026604, 0.020644694566726685, 0.029740426689386368, -0.029311971738934517, -0.06848761439323425, -0.0674775242805481, 0.06178939715027809, -0.003601530333980918, 0.03230693191289902, -0.06799844652414322, -0.018312137573957443, -0.00882615614682436, 0.09439830482006073, -0.10490328073501587, 0.0019365682965144515, 0.023713791742920876, -0.006338260602205992, 0.07812654972076416, -0.007310161367058754, 0.04305695742368698, 0.059695370495319366, -0.1411200761795044, 0.12611250579357147, 0.04341692477464676, -0.10202603787183762, -0.06826306134462357, 0.12234354019165039, -0.10471373796463013, -0.03466927632689476, -0.07176949083805084, 0.08422104269266129, 0.03718014433979988, -0.039430513978004456, 0.12818655371665955, 0.004152677021920681, 0.118596151471138, -0.024253971874713898, -0.03294478356838226, 0.021922264248132706, -0.02473416179418564, -0.08937784284353256, -0.08161510527133942, 0.08946863561868668, -0.07869300246238708, -0.03633825108408928, 0.03692970797419548, 0.11542408168315887, -0.005049743223935366, 0.0891941636800766, -0.013918529264628887, -0.07047073543071747, -0.024464823305606842, 0.1260533332824707, -0.013174754567444324, 0.07545673847198486, 0.0993136540055275, -0.12851253151893616, -0.03309961035847664, 0.04247741773724556, 0.08496655523777008, -0.04724358022212982, 0.01774907298386097, -0.14733968675136566, 0.07661473751068115, -0.047332655638456345, -0.21175110340118408, -0.0583920031785965, -0.09145092964172363, 0.07694998383522034, -0.05063065141439438, -0.06068434193730354, -0.00011453998013166711, 0.0709512010216713, -0.10560811311006546, 0.030618390068411827, 0.03214675933122635, 0.046090200543403625, -0.05965166166424751, -0.0013844288187101483, 0.06502626836299896, -0.022253787145018578, -0.09021012485027313, 0.008045698516070843, 0.04821997135877609, 0.0544079951941967, 0.030229995027184486]]\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "\n",
    "print('body quality ',data_processor.scores[d]['cr_zhongshan_wxhpoc-ch01065-fid-track-1430996-a14ae5ee-49be-4b23-8f68-1e1718453026'])\n",
    "print('uniform score: ', data_processor.staff_scores[d]['cr_zhongshan_wxhpoc-ch01065-fid-track-1430996-a14ae5ee-49be-4b23-8f68-1e1718453026'])\n",
    "print('uniform feat: ', data_processor.staff_feat[d]['cr_zhongshan_wxhpoc-ch01065-fid-track-1430996-a14ae5ee-49be-4b23-8f68-1e1718453026'])\n",
    "\n",
    "from PIL import  Image\n",
    "im = Image.open('/root/mall_stat/data/mall_staff_full/images/CR_zhongshan_wxhpoc/20240615/cr_zhongshan_wxhpoc-ch01065-fid-track-1430996-a14ae5ee-49be-4b23-8f68-1e1718453026.jpg')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(13456948, 13456948)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(imgs), len(scores)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['20240615',\n",
       " '20240530',\n",
       " '20240508',\n",
       " '20240522',\n",
       " '20240503',\n",
       " '20240612',\n",
       " '20240525',\n",
       " '20240604']"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_processor.dates"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# statistic of  body quality "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAHHCAYAAACRAnNyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/TGe4hAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAwDUlEQVR4nO3deZzN9eLH8fcxy5mJmbEOMxrGkj1GtixdlJKt0q8b2d3IdUkRRSpCqIRuhkoYv2vrpyyVnUhZblKufTdZspSYRRzMfH5//B5zfk0zYo6Z+X6G1/Px+D665/P9fM/3fVzNvPtux2WMMQIAALBQPqcDAAAAXAtFBQAAWIuiAgAArEVRAQAA1qKoAAAAa1FUAACAtSgqAADAWhQVAABgLYoKAACwFkUFgM9cLpeGDx/udIxs1a1bN0VHR6cbuxU/J5BXUFSAW0hcXJxcLle6JTw8XE2bNtWyZcucjndDjh49qr///e+Kjo6W2+1WeHi42rZtq40bNzodzWvjxo0aPny4zp8/73QU4Jbn73QAANlvxIgRKlOmjIwxOn36tOLi4tSyZUt9/vnnat26tdPxrmnDhg1q2bKlJKlHjx6qUqWKTp06pbi4ODVq1EixsbHq3bt3rue6ePGi/P3//8flxo0b9frrr6tbt24qWLBgrucBbicUFeAW1KJFC9WuXdv7+umnn1bx4sU1d+5ca4vKuXPn9MQTTyg4OFgbNmxQuXLlvOsGDBig5s2b69lnn1XNmjV177335mq2oKCgXN0fgP/HqR/gNlCwYEEFBwenOyogSRcuXNALL7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ON7A8L5LC6deuqWbNmatasmTp27KglS5aoSpUq6tu3ry5fvixJ+vHHHxUZGZmhHFSuXNm7Pu2f+fLly3DdSMWKFTPst1KlSqpTp45mz57tHZs9e7buvfdelS9f/k8zh4SEXLeApK0PDw//03mZ2bVrl9q2bauwsDCFhoaqWLFi3vKUkJCQ5fe7li5duujo0aP6+uuvJUmrV6/W6dOn1blz52zbB3A7uWWKyoULF1SjRg3Fxsb6/B7PPfecPvroI40bN0579+7VZ599prp162ZjSsAZ+fLlU9OmTXXy5EkdOHAgR/fVpUsXffXVVzp+/LgOHTqkzZs3X/doiiRVqVJF+/btk8fjueac7du3KzAwUCVLlpSkTC+klZThAtnz58+rcePG+s9//qMRI0bo888/16pVq/Tmm29KklJTU2/0411X8+bNVbx4cc2aNUuSNGvWLJUoUULNmjXLtn0At5Nbpqi0aNFCo0aNynARXxqPx6OBAweqZMmSyp8/v+rVq6d169Z51+/Zs0dTpkzR4sWL9cgjj6hMmTKqVauWHnzwwVz6BEDOunr1qiQpOTlZklS6dGn99NNPGY5ipJ0GKV26tPefqampOnToULp5+/bty3Q/7du3l5+fn+bOnavZs2crICBA7dq1u26+Nm3a6NKlS5o/f36m6+Pj4/X111+rdevW3tM4hQoVkqQMD15LOxqUZt26dTp79qzi4uL03HPPqXXr1mrWrJl3+6y6VkGSJD8/P3Xo0EGffPKJzp07p0WLFumpp56Sn5+fT/sCbne3TFG5nr59+2rTpk2aN2+etm/frr/+9a96+OGHvf91+fnnn6ts2bL64osvVKZMGUVHR6tHjx769ddfHU4O3LwrV65o5cqVCgwM9J7aadmypVJSUjRp0qR0cydMmCCXy6UWLVpIkvef//znP9PNmzhxYqb7Klq0qFq0aKFZs2Zp9uzZevjhh713xvyZXr16qUSJEho0aJAOHz6cbt2lS5fUvXt3uVwuvfjii97xtNNR69ev945duHDBeytzmrSSYH532/Xly5c1efLk6+bKTNq1Jtd6Mm3nzp117tw59erVK8PdVgCy5ra4Pfno0aOaMWOGjh49qsjISEnSwIEDtXz5cs2YMUOjR4/W4cOH9eOPP2r+/Pn67//+b6WkpKh///564okn9OWXXzr8CYCsWbZsmffIyJkzZzRnzhwdOHBAgwcPVmhoqKT/O4LRtGlTDR06VPHx8apRo4ZWrlypxYsX6/nnn/eWgJiYGD311FOaPHmyEhIS1KBBA61Zs0YHDx685v67dOmiJ554QpI0cuTIG8pcqFAhffLJJ2rZsqXuueeeDE+mPXz4sCZNmqR69ep5t3nooYdUqlQpPf300xo0aJD8/Pw0ffp0FStWTEePHvXOa9CggQoVKqSuXbuqX79+crlc+te//pXheTE3qlatWpKkoUOHqn379goICFCbNm28BaZmzZqqVq2a5s+fr8qVK+uee+7xaT8AdGvenizJLFy40Pv6iy++MJJM/vz50y3+/v7mySefNMYY07NnTyPJ7Nu3z7vd1q1bjSSzd+/e3P4IgE8yuz05KCjIxMTEmClTppjU1NR085OSkkz//v1NZGSkCQgIMHfddZd5++23M8y7ePGi6devnylSpIjJnz+/adOmjTl27FiG23bTeDweU6hQIRMWFmYuXryYpc8QHx9vnnnmGVOqVCnj7+/v/RyrV6/OdP7WrVtNvXr1TGBgoClVqpQZP358prcnb9iwwdx7770mODjYREZGmhdffNGsWLHCSDJr1671zruR25ONMWbkyJGmZMmSJl++fJneqvzWW28ZSWb06NFZ+vwA0nMZ4+N/Ulgs7emYjz32mKT/uz2yY8eO2rVrV4bzxAUKFFCJEiU0bNgwjR49WleuXPGuu3jxou644w6tXLmSa1WALLh69aoiIyPVpk0bTZs27abea82aNWrZsqUaNWqkZcuWKTAwMJtS5qx3331X/fv3V3x8vEqVKuV0HCDPui2uUalZs6ZSUlJ05swZlS9fPt1SokQJSVLDhg119erVdBcM7t+/X9L/X1QI4MYsWrRIP//8s7p06XLT7/XAAw9o5syZWrt2rbp37+7z6ZrcZIzRtGnT1LhxY0oKcJNumSMqycnJ3nPmNWvW1Pjx49W0aVMVLlxYpUqVUqdOnbRhwwa98847qlmzpn7++WetWbNG1atXV6tWrZSamqo6deqoQIECmjhxolJTU9WnTx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M/PcXz5Zdf+hwIAAAgjU9FJe36lDRXrlzRtm3btHPnzgxfVggAAOArn4rKhAkTMh0fPny4kpOTbyoQAABAmmy9RqVTp058zw8AAMg22VpUNm3apKCgoOx8SwAAcBvz6dTP448/nu61MUYnT57Ud999p1dffTVbggEAAPhUVMLCwtK9zpcvnypWrKgRI0booYceypZgAAAAPhWVGTNmZHcOAACADHwqKmm2bt2qPXv2SJKqVq2qmjVrZksoAAAAyceicubMGbVv317r1q1TwYIFJUnnz59X06ZNNW/ePBUrViw7MwIAgNuUT3f9PPvss0pKStKuXbv066+/6tdff9XOnTuVmJiofv36ZXdGAABwm/LpiMry5cu1evVqVa5c2TtWpUoVxcbGcjEtAADINj4dUUlNTVVAQECG8YCAAKWmpt50KAAAAMnHonL//ffrueee008//eQdO3HihPr3768HHngg28IBAIDbm09FZdKkSUpMTFR0dLTKlSuncuXKqUyZMkpMTNR7772X3RkBAMBtyqdrVKKiovT9999r9erV2rt3rySpcuXKatasWbaGw60jevASpyNIkuLHtnI6AgAgC7J0ROXLL79UlSpVlJiYKJfLpQcffFDPPvusnn32WdWpU0dVq1bV119/fcPvN2XKFFWvXl2hoaEKDQ1V/fr1tWzZsix/CAAAcGvKUlGZOHGievbsqdDQ0AzrwsLC1KtXL40fP/6G3+/OO+/U2LFjtXXrVn333Xe6//779eijj2rXrl1ZiQUAAG5RWSoq//nPf/Twww9fc/1DDz2krVu33vD7tWnTRi1bttRdd92lChUq6I033lCBAgW0efPmrMQCAAC3qCxdo3L69OlMb0v2vpm/v37++WefgqSkpGj+/Pm6cOGC6tevn+kcj8cjj8fjfZ2YmOjTvgAAQN6QpSMqJUuW1M6dO6+5fvv27YqIiMhSgB07dqhAgQJyu936+9//roULF6pKlSqZzh0zZozCwsK8S1RUVJb2BQAA8pYsFZWWLVvq1Vdf1aVLlzKsu3jxooYNG6bWrVtnKUDFihW1bds2/fvf/1bv3r3VtWtX7d69O9O5Q4YMUUJCgnc5duxYlvYFAADyliyd+nnllVe0YMEC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AGtZUVRiY2MVHR2toKAg1atXT99++63TkQAAgAUc/66fjz/+WAMGDND777+vevXqaeLEiWrevLn27dun8PBwp+MBgBVs+E4ivo8ITnD8iMr48ePVs2dPde/eXVWqVNH777+vO+64Q9OnT3c6GgAAcJijReXy5cvaunWrmjVr5h3Lly+fmjVrpk2bNjmYDAAA2MDRUz+//PKLUlJSVLx48XTjxYsX1969ezPM93g88ng83tcJCQmSpMTExJwNarFUz29OR5B0/f8PyHnjbuTvc17IaUNGiZzZ6Xb+WYvslfZ3yRhz3bmOX6OSFWPGjNHrr7+eYTwqKsqBNPi9sIlOJ7gxeSFnXsgokTO75YWceSEj8pakpCSFhYX96RxHi0rRokXl5+en06dPpxs/ffq0SpQokWH+kCFDNGDAAO/r1NRU/frrrypSpIhcLleO582KxMRERUVF6dixYwoNDXU6zjWRM3vlhZx5IaNEzuyWF3LmhYwSObODMUZJSUmKjIy87lxHi0pgYKBq1aqlNWvW6LHHHpP0f+VjzZo16tu3b4b5brdbbrc73VjBggVzIanvQkNDrfsLkhlyZq+8kDMvZJTImd3yQs68kFEi58263pGUNI6f+hkwYIC6du2q2rVrq27dupo4caIuXLig7t27Ox0NAAA4zPGi0q5dO/3888967bXXdOrUKcXExGj58uUZLrAFAAC3H8eLiiT17ds301M9eZnb7dawYcMynKqyDTmzV17ImRcySuTMbnkhZ17IKJEzt7nMjdwbBAAA4ADHn0wLAABwLRQVAABgLYoKAACwFkUFAABYi6JyE2JjYxUdHa2goCDVq1dP33777Z/Onz9/vipVqqSgoCDdfffdWrp0qXU5d+3apf/6r/9SdHS0XC6XJk6cmCsZs5pz6tSpuu+++1SoUCEVKlRIzZo1u+6fvxM5FyxYoNq1a6tgwYLKnz+/YmJi9K9//cuqjL83b948uVwu7wMYc1pWcsbFxcnlcqVbgoKCrMspSefPn1efPn0UEREht9utChUq5Mq/71nJ2aRJkwx/ni6XS61atbImoyRNnDhRFStWVHBwsKKiotS/f39dunQpRzNmNeeVK1c0YsQIlStXTkFBQapRo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aAHTiiAsAnJ06c0MWLFyVJpUqV8umaEgC4HooKAACwFqd+AACAtSgqAADAWhQVAABgLYoKAACwFkUFAABYi6ICAACsRVEBAADWoqgAAABrUVQAAIC1/hchWwiIQj2yFgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "qualities = scores.tolist()\n",
    "\n",
    "def count_intervals(lst):\n",
    "    intervals = [0] * 11  # 初始化 11 个区间的计数为 0\n",
    "    for num in lst:\n",
    "        index = int(num * 10)  # 向下取整\n",
    "        intervals[index] += 1\n",
    "    return intervals\n",
    "\n",
    "intervals = count_intervals(qualities)\n",
    "\n",
    "# labels = ['0.0 - 0.1', '0.1 - 0.2', '0.2 - 0.3', '0.3 - 0.4', '0.4 - 0.5', '0.5 - 0.6', '0.6 - 0.7', '0.7 - 0.8', '0.8 - 0.9', '0.9 - 1.0']\n",
    "\n",
    "labels = ['0.0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9','1.0']\n",
    "plt.bar(labels, intervals)\n",
    "plt.xlabel('[x,x+1)')\n",
    "plt.ylabel('Count')\n",
    "plt.title('Body Quality')\n",
    "plt.show()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "body quality at 0.200000 quantile is \t 0.13232421875 \t\t the sample number higher than this quality is \t 10765558\n",
      "body quality at 0.250000 quantile is \t 0.14237138256430626 \t\t the sample number higher than this quality is \t 10092711\n",
      "body quality at 0.300000 quantile is \t 0.15348653495311737 \t\t the sample number higher than this quality is \t 9419863\n",
      "body quality at 0.350000 quantile is \t 0.1657167226076126 \t\t the sample number higher than this quality is \t 8747016\n",
      "body quality at 0.400000 quantile is \t 0.1792515367269516 \t\t the sample number higher than this quality is \t 8074168\n",
      "body quality at 0.450000 quantile is \t 0.19426990449428555 \t\t the sample number higher than this quality is \t 7401321\n",
      "body quality at 0.500000 quantile is \t 0.21094238758087158 \t\t the sample number higher than this quality is \t 6728474\n",
      "body quality at 0.550000 quantile is \t 0.22962535917758942 \t\t the sample number higher than this quality is \t 6055626\n",
      "body quality at 0.600000 quantile is \t 0.250688475370407 \t\t the sample number higher than this quality is \t 5382779\n",
      "body quality at 0.650000 quantile is \t 0.27442751973867413 \t\t the sample number higher than this quality is \t 4709931\n",
      "body quality at 0.700000 quantile is \t 0.3013076722621917 \t\t the sample number higher than this quality is \t 4037084\n",
      "body quality at 0.750000 quantile is \t 0.33213210105895996 \t\t the sample number higher than this quality is \t 3364237\n",
      "body quality at 0.800000 quantile is \t 0.3681056678295135 \t\t the sample number higher than this quality is \t 2691389\n",
      "body quality at 0.850000 quantile is \t 0.411285400390625 \t\t the sample number higher than this quality is \t 2018542\n",
      "body quality at 0.900000 quantile is \t 0.46586267650127394 \t\t the sample number higher than this quality is \t 1345694\n",
      "body quality at 0.950000 quantile is \t 0.5437542200088501 \t\t the sample number higher than this quality is \t 672847\n"
     ]
    }
   ],
   "source": [
    "qualities = scores\n",
    "qualities = sorted(qualities)\n",
    "length  = len(qualities)\n",
    "for  proportion in  np.arange(0.2,1,0.05):\n",
    "    print('body quality at %f quantile is \\t'%(proportion),np.quantile(qualities,proportion),'\\t\\t the sample number higher than this quality is \\t', int(length * (1 - proportion)) )\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.11401367, 0.43112183, 0.10562626, ..., 0.28149414, 0.59131598,\n",
       "       0.20756392])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
